<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html>

    <head>

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <title>LeisBlog | Tags</title>

        <link href="/static/css/bootstrap.min.css" rel="stylesheet">
        <link href="/static/font-awesome/css/font-awesome.css" rel="stylesheet">
        <link href="/static/css/animate.css" rel="stylesheet">
        <link href="/static/css/style.css" rel="stylesheet">
        <link href="/static/css/plugins/footable/footable.core.css" rel="stylesheet"> 
        <script data-main="/static/js/admin-frame.js" src="/static/js/require.min.js"></script>
    </head>

    <body class="white-bg">
        <i id="scriptTag">/static/js/admin/admin-tags-config.js</i>
        <div class="panel panel-primary">
            <div class="panel-heading">
                标签管理
            </div>
            <div class="panel-body">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a data-toggle="tab" href="#tags-add">
                                标签创建
                            </a>
                        </li>
                        <li>
                            <a data-toggle="tab" href="#tags-list">标签列表</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tags-add" class="tab-pane active">
                            <div class="panel-body">
                                <form class="form-inline" id="tags-config-form">
                                    <div class="form-group">
                                        <label class="sr-only">标签名</label>
                                        <input type="text" name="tag-name" id="tag-name" class="form-control">
                                    </div>
                                    <button id="tags-add-btn" class="btn btn-white" type="button"><i class="fa fa-plus text-navy"></i></button>
                                </form>
                            </div>
                        </div>
                        <div id="tags-list" class="tab-pane">
                            <div class="panel-body">
                                <div class="input-group">
                                    <span class="input-group-btn">
                                        <button type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
                                    </span>
                                    <input type="text" class="form-control" id="filter" placeholder="">
                                </div>
                                <table id="tags-list-table" class="footable table table-stripped toggle-arrow-tiny" data-page-size="8" data-filter='#filter'>
                                    <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>标签名称</th>
                                            <th>创建时间</th>
                                            <th>标签状态</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach ($tags as $item): ?>
                                            <tr>
                                                <td><?php echo $item['tag_id']; ?></td>
                                                <td><?php echo $item['tag_name']; ?></td>
                                                <td><?php echo date('Y-m-d H:m:s', $item['tag_create_time']); ?></td>
                                                <?php if ($item['tag_status'] == 1) { ?>
                                                    <td class="tag-status text-navy"><?php echo '开启'; ?></td>
                                                <?php } elseif ($item['tag_status'] == 2) { ?>
                                                    <td class="tag-status text-danger"><?php echo '关闭'; ?></td>
                                                <?php } ?>      
                                                <td>
                                                    <button data-tagid = "<?php echo $item['tag_id']; ?>" class="open-tag-btn btn btn-circle btn-danger" title="开启"><i class="fa fa-heart"></i></button>
                                                    <button data-tagid = "<?php echo $item['tag_id']; ?>" class="close-tag-btn btn btn-circle btn-primary" title="关闭"><i class="fa fa-mail-reply"></i></button>
                                                    <button data-tagid = "<?php echo $item['tag_id']; ?>" class="del-tag-btn btn btn-circle btn-success" title="删除"><i class="fa fa-times"></i></button>
                                                </td>
                                            </tr>
                                        <?php endforeach; ?>
                                    </tbody>
                                    <tfoot>
                                        <tr>
                                            <td colspan="5">
                                                <ul class="pagination pull-right"></ul>
                                            </td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

    </body>

</html>



